//------------------------------------------------------------------------------
// The contents of this file are subject to the nopCommerce Public License Version 1.0 ("License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at  http://www.nopCommerce.com/License.aspx. 
// 
// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
// See the License for the specific language governing rights and limitations under the License.
// 
// The Original Code is nopCommerce.
// The Initial Developer of the Original Code is NopSolutions.
// All Rights Reserved.
// 
// Contributor(s): _______. 
//------------------------------------------------------------------------------

using NopSolutions.NopCommerce.BusinessLogic.Infrastructure;
using NopSolutions.NopCommerce.BusinessLogic.Media;

namespace NopSolutions.NopCommerce.BusinessLogic.Alesko
{
    /// <summary>
    /// Represents a product picture mapping
    /// </summary>
    public partial class Banner : BaseEntity
    {
        /// <summary>
        /// Represents a banner type
        /// </summary>
        public enum BannerTypeEnum : int
        {
            /// <summary>
            /// Top banner (one per site)
            /// </summary>
            TopMain = 1,
            /// <summary>
            /// Right banner
            /// </summary>
            RightMain = 2,
            /// <summary>
            /// Top banner, near logo (one per site)
            /// </summary>
            TopLogoMain = 3
        }

        #region Properties
        /// <summary>
        /// Gets or sets the Banner identifier
        /// </summary>
        public int BannerID { get; set; }

        /// <summary>
        /// Gets or sets the picture identifier
        /// </summary>
        public int? PictureID { get; set; }

        /// <summary>
        /// Gets or sets the type of banner
        /// </summary>
        public int BannerType { get; set; }

        /// <summary>
        /// Gets or sets the order
        /// </summary>
        public int DisplayOrder { get; set; }

        /// <summary>
        /// Gets or sets the url
        /// </summary>
        public string Url { get; set; }
        #endregion 
        
        #region Custom Properties

        public int PictureIdInt
        {
            get
            {
                int result = -1;

                if (PictureID != null)
                    result = (int)PictureID;

                return result;
            }
        }
        /// <summary>
        /// Gets the picture
        /// </summary>
        public Picture Picture
        {
            get
            {
                return IoC.Resolve<IPictureService>().GetPictureById(this.PictureIdInt);
            }
        }
        #endregion

        #region Navigation Properties

        /// <summary>
        /// Gets the picture
        /// </summary>
        public virtual Picture NpPicture { get; set; }

        #endregion
    }

}
